#include<stdio.h>
int nt[]={0,1,1,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1};
int a[30],used[30],kq=0;
int ret[]={0,1,2,2,4,96,1024,2880,81024,770144};
int process(int n,int i){
    if(i==2*n+1){
        if(nt[a[1]+a[2*n]]){
            kq++;
            int j;printf("\n");for(j=1;j<2*n;j++)printf("%d ",a[j]);printf("%d",a[2*n]);
            if(kq==10000)return 1;
            else return 0;
        }
        return 0;
    }
    for(a[i]=2;a[i]<=2*n;a[i]++)
        if(used[a[i]]==0 && nt[a[i]+a[i-1]]){
            used[a[i]]=1;
            if(process(n,i+1))return 1;
            used[a[i]]=0;
        }
    return 0;
}
int main(){
    int n;
    a[1]=1;
    scanf("%d",&n);
    printf("%d",ret[n]);
    process(n,2);
    return 0;
}
